package pinpass;

public class Coordenada {

	private char coordenadaX;
	private int coordenadaY;
	
	public Coordenada(char coordenadaX, int coordenadaY) {
		super();
		setCoordenadaX(coordenadaX);
		setCoordenadaY(coordenadaY);
	}
	
	public Coordenada(int coordenadaX, int coordenadaY) {
		super();
		if (coordenadaX>=0 && coordenadaX<=10 ){
			setCoordenadaX((char) (coordenadaX+64));
			setCoordenadaY(coordenadaY);
		}
	}
	

	public char getCoordenadaX() {
		return coordenadaX;
	}
	public int getIntCoordenadaX() {
		return (char) (coordenadaX-64);
	}

	public void setCoordenadaX(char coordenadaX) {
		if ((int)coordenadaX >=65 && (int)coordenadaX <75)// Validacion A - J
			this.coordenadaX = coordenadaX;
	}
	public int getCoordenadaY() {
		return coordenadaY;
	}
	public void setCoordenadaY(int coordenadaY) {
		this.coordenadaY = coordenadaY;
	}
	

	public String toString(){
		String out = new String().concat(String.valueOf(this.getCoordenadaX())).concat(String.valueOf(this.getCoordenadaY()));
		return out;
	}
}
